package com.tuda.common.enums;

/**
 * @ClassName OrderPayType
 * @Description TODO
 * @Author Admin
 * @Date 2023/10/12 14:46
 * @Version 1.0
 **/
public enum OrderPayType {
    PAY_TYPE_1(1L, "到付"),
    PAY_TYPE_2(2L, "现付"),
    PAY_TYPE_3(3L, "欠付"),
    PAY_TYPE_4(4L, "已还款"),
    ;

    private final Long code;
    private final String info;

    OrderPayType(Long code, String info)
    {
        this.code = code;
        this.info = info;
    }

    public Long getCode()
    {
        return code;
    }

    public String getInfo()
    {
        return info;
    }

    public static String getNameByCode(Long code) {
        OrderPayType[] enums = OrderPayType.values();
        for (int i = 0; i < enums.length; i++) {
            if (enums[i].getCode().equals(code)) {
                return enums[i].getInfo();
            }
        }
        return "";
    }

}
